<template>
    <div class="mui-numbox" data-numbox-min='1' style="height: 22px">
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" :value="initCount" ref="numBox" @change="changNum"/>
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>

<script>
    import mui from '../../lib/MUI/js/mui.min.js'

    export default {
        name: "GoodsInfo_Numbox",
        mounted() {
            mui('.mui-numbox').numbox()
        },
        methods: {
            changNum() {
                this.$store.commit('addCart', {
                    num: this.$refs.numBox.value,
                    id: this.goodsId
                })
            }
        },
        props: ["initCount", "goodsId"]
    }
</script>

<style scoped>

</style>